
public class Test {
    public static void main(String[] args) throws Exception {
        HomeTheaterFacade ht = new HomeTheaterFacade();
        ht.watchMovie(); // 一行搞定
    }

}

// 外观模式（Facade）= “一键快捷键”
// 把一群复杂的子系统接口打包成一个简单入口，让客户端只跟 Facade 说话，不用理会内部乱七八糟的协作细节。

// 子系统
class Projector {
    void on() {
        System.out.println("Projector ON");
    }
}

class Screen {
    void down() {
        System.out.println("Screen DOWN");
    }
}

class Amplifier {
    void on() {
        System.out.println("Amp ON");
    }
}

class Lights {
    void dim() {
        System.out.println("Lights DIM");
    }
}

// 外观
class HomeTheaterFacade {
    private Projector p = new Projector();
    private Screen s = new Screen();
    private Amplifier a = new Amplifier();
    private Lights l = new Lights();

    public void watchMovie() {
        l.dim();
        s.down();
        p.on();
        a.on();
    }

    public void endMovie() {
        System.out.println("Shutting down theater...");
    }
}